﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Products.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .style1
        {
            width: 61%;
        }
        .style2
        {
            width: 305px;
        }
        .style3
        {
            width: 279px;
        }
    </style>
    </head>
<body>
    <h1 style="color:Maroon; font-size: 22px">Products</h1>
    <form id="form1" runat="server">
    <div>
    
    <table style="width: 76%">
        <tr>
            <td class="style2">
                <table>
                    <tr>
                        <td class="style3">
                    
                            <table>
                <tr>
                    <td>
                    Product ID:
                    </td>
                    <td>
                        <asp:TextBox ID="txtID" runat="server" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        Product's Name:
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductName" runat="server"> </asp:TextBox>
                        
                        
                    </td>
                </tr>
                <tr>
                <td>
                </td>
                    <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="txtProductName" Display="Dynamic" 
            ErrorMessage="Please enter Product's Name" ValidationGroup="Validate"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        Supplier:
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSupplier" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        Category:
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlCategory" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        Unit Price:
                    </td>
                    <td>
                        <asp:TextBox ID="txtPrice" runat="server"> </asp:TextBox>
                    </td>
                </tr>
                
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ControlToValidate="txtPrice" Display="Dynamic" 
            ErrorMessage="Please enter Unit Price" ValidationGroup="Validate"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                
                <tr>
                    <td>
                    </td>
                    <td>
                          <asp:CompareValidator ID="CompareValidator1" runat="server" 
            ControlToValidate="txtPrice" Display="Dynamic" 
            ErrorMessage="Invalid Unit Price" Operator="GreaterThanEqual" Type="Double" 
            ValueToCompare="0" ValidationGroup="Validate"></asp:CompareValidator>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        Discontinued:
                    </td>
                    <td>
                        <asp:CheckBox ID="chkDiscontinued" runat="server" />
                        
                    </td>
                </tr>
                
                        </table>
                        </td>
                    </tr>
                    
                    <tr>
                        <td class="style3">
                        <table>
            <tr>
                <td>
                    <asp:Button ID="btnNew" runat="server" Text="New" onclick="btnNew_Click" 
                        Width="62px" />
                    <asp:Button ID="btnAdd" runat="server" Text="Add" onclick="btnAdd_Click" 
                        Width="62px" ValidationGroup="Validate" />
                </td>
                <td>
                   <asp:Button ID="btnUpdate" runat="server" Text="Update" 
                        onclick="btnUpdate_Click" Width="62px" />
                   <asp:Button ID="btnDelete" runat="server" Text="Delete" 
                        onclick="btnDelete_Click" Width="62px" />
                </td>
            </tr>
            
            
        </table>
                        </td>
                    </tr>
                </table>
            </td>
            
            <td class="style1">
                <table>
            
                    <tr>
                       <td>
                            <table>
                        <tr>
                        <td>
                        Filter By Category:
                    </td>
                        <td >
                         <asp:DropDownList ID="ddlFilterCategory" runat="server">
                        </asp:DropDownList>
                        <asp:Button ID="btnFilter" runat="server" Text="Filter" onclick="btnFilter_Click"/>
                    </td>
                    </tr>
                    
                    <tr>
                        <td>
                            Filter By Supplier:
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlFilterSupplier" runat="server"></asp:DropDownList>
                            <asp:Button ID="btnFilterSupplier" runat="server" Text="Filter" 
                                onclick="btnFilterSupplier_Click" />
                        </td>
                    </tr>
                    
                        <tr>
                           <td>
                        Search By Name:
                    </td>
                           <td>
                        <asp:TextBox ID="txtSearch" runat="server" ontextchanged="txtSearch_TextChanged"> </asp:TextBox>
                    </td>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" 
                            Text="Search" />
                    </td>
                    </tr>
                    </table>
                       </td>
                    </tr>
                    
                    <tr>
                        <td>
                              <table>
          
           
                <asp:GridView ID="gvProducts" runat="server" onpageindexchanging="gvProducts_PageIndexChanging" 
                                      onselectedindexchanged="gvProducts_SelectedIndexChanged" >
                </asp:GridView>
             </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        
       
    </table>
    
    </div>
        
      
        
        
        
      
        
    </form>
</body>
</html>
